package com.sskj.motherboard.runner;

import com.sskj.motherboard.server.NettyServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class NettyServerRunner implements CommandLineRunner {

    @Autowired
    private NettyServer nettyServer;

    @Override
    public void run(String... args) throws Exception {
        new Thread(() -> {
            try {
                nettyServer.start();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }).start();
    }
}
